approval-ui: fix Grafana dashboard iframe error detection#23
Merged
Conversation
The iframe onError event doesn't fire for ERR_CONNECTION_REFUSED, so probing Grafana availability on mount ensures the custom error state displays when Grafana is unreachable. Also reformatted with prettier.
The RETRY button now clears the error state and probes Grafana again instead of just showing the iframe without verification.
Minor formatting adjustments to audit-archiver and demo-agent for improved readability.
GRANT SELECT/INSERT and REVOKE UPDATE/DELETE in partition.rs triggered the check because the pattern matched any format! containing those keywords. Narrow to DML-specific phrases (SELECT FROM, INSERT INTO, UPDATE SET, DELETE FROM) so legitimate DDL with internally-generated partition names is excluded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Grafana dashboard page was showing the browser's native
ERR_CONNECTION_REFUSEDerror inside the iframe instead of the custom "GRAFANA UNREACHABLE" error state. This is becauseonErroron<iframe>elements only fires for HTTP-level errors, not network-level connection failures.Changes
Grafana availability probe — on component mount, a
no-corsfetch checks whether Grafana is reachable. If the connection is refused,iframeErroris set immediately and the custom error card displays before the iframe ever renders.Retry reprobe — the RETRY button now re-probes Grafana availability rather than blindly showing the iframe. It clears the error state (giving visual feedback), then probes again; if Grafana is still down, the error state returns.
Formatting — prettier and rustfmt reformatted approval-ui and audit-archiver/demo-agent files.